<!--
 * @Author: anshengtyp
 * @Date: 2024-01-10 11:00:57
 * @LastEditTime: 2024-01-11 10:01:47
 * @LastEditors: anshengtyp
 * @Description:日志组件
-->
<template>
  <el-card class="box-card" v-if="flowList.length" shadow="never">
    <div slot="header" class="clearfix">
      <div class="logsTitle">审批日志（{{ flowList.length }}）</div>
    </div>
    <div class="logsBox">
      <div class="logsRow" v-for="item in flowList">
        <div class="logsContent">
          <span class="logsTitle">
            {{ item.wfActivityName }}:{{ item.approver }}
          </span>
          <div class="logsCol">
            <span class="status">
              <dict-tag style="color: #606266;font-size: 12px;padding-top: 5px;" :options="dict.type.xmgl_process_status"
                :value="item.status"></dict-tag>
            </span>
            <div class="time">
              {{ item.doneTime }}</div>
            <div class="opinions" v-if="item.opinions">审批意见：{{ item.opinions }}</div>
          </div>
        </div>
      </div>
    </div>
  </el-card>
</template>

<script>
export default {
  dicts: ['xmgl_process_status'],
  props: {
    logsData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      flowList: []
    };
  },

  watch: {
    logsData: {
      immediate: true,
      deep: true,
      handler(n) {
        if (n.length) {
          this.flowList = n;
        }
      }
    }
  },
  mounted() {

  },

  methods: {

  },
};
</script>

<style lang="scss" scoped>
::v-deep .el-card__header {
  padding: 20px;
  font-weight: 500;
  font-size: 16px;
}

::v-deep .el-card__body {
  padding: 0px !important;

  .logsBox {
    width: 100%;
    padding-top: 20px;

    .logsRow {
      display: flex;
      align-items: center;
      margin-left: 20px;
      height: 110px;

      .logsContent {
        display: flex;
        flex-direction: column;
        margin-left: 20px;

        .logsTitle {
          font-weight: 400;
          font-size: 14px;
          color: #303133;
          line-height: 24px;
        }
      }

      .logsCol {
        padding-left: 15px;
        border-left: 2px #DCDFE6 solid;
        margin: 10px 0;
        height: 55px;

        .status {
          font-weight: 400;
          font-size: 12px;
          color: #606266;
          letter-spacing: 0;
        }

        .time {
          font-weight: 400;
          font-size: 12px;
          color: #C0C4CC;
        }

        .opinions {
          font-weight: 400;
          font-size: 14px;
          color: #000;
          width: 600px;
          height: 40px;
          line-height: 40px;
          background: #f2f2f2;
          border-radius: 4px;
          padding-left: 10px;
        }
      }
    }
  }
}
</style>
